package com.lancoo.znbkxx.teacher.aibkTestCoach.aibkTools

import android.content.Intent
import com.lancoo.znbkxx.teacher.aibkTestCoach.checkKnowledgePoint.AibkKnowledgeListActivity
import androidx.appcompat.app.AppCompatActivity
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.entity.PaperEvaluationInfor
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.entity.PaperPerAnalysisInfor
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.entity.QuesEvaluationDetail
import com.lancoo.znbkxx.teacher.model.OperationHelp
import com.lancoo.znbkxx.teacher.ui.activity.CommentDetailActivity
import java.util.ArrayList

object JumpActivityHelp {

    /*
  * 跳转进入知识点列表
  * */
    fun paperEvaluationJumpToKnowledgePointActivity(activity: AppCompatActivity, paperEvaluationInfor: PaperEvaluationInfor, index_A: Int, index_B: Int) {
        var listCode: ArrayList<String> = ArrayList<String>()
        var listName: ArrayList<String> = ArrayList<String>()
        var listUniqueCode: ArrayList<String> = ArrayList<String>()
        val importKlgListSize = paperEvaluationInfor.TypeList[index_A].QuesDetailList[index_B].ImportKlgList.size
        for (i in 0 until importKlgListSize) {
            listCode.add(paperEvaluationInfor.TypeList[index_A].QuesDetailList[index_B].ImportKlgList[i].Code)
            listName.add(paperEvaluationInfor.TypeList[index_A].QuesDetailList[index_B].ImportKlgList[i].Name)
            listUniqueCode.add(paperEvaluationInfor.TypeList[index_A].QuesDetailList[index_B].ImportKlgList[i].UniqueCode)
        }
        AibkKnowledgeListActivity.launch(activity, listCode, listName, listUniqueCode)
    }

    /*
    * 跳转进入知识点列表
    * */
    fun paperAnalysisJumpToKnowledgePointActivity(activity: AppCompatActivity, paperPerAnalysisInfor: PaperPerAnalysisInfor, index_A: Int, index_B: Int) {
        var listCode: ArrayList<String> = ArrayList<String>()
        var listName: ArrayList<String> = ArrayList<String>()
        var listUniqueCode: ArrayList<String> = ArrayList<String>()
        val importKlgListSize = paperPerAnalysisInfor.TypeList[index_A].QuesDetailList[index_B].ImportKlgList.size
        for (i in 0 until importKlgListSize) {
            listCode.add(paperPerAnalysisInfor.TypeList[index_A].QuesDetailList[index_B].ImportKlgList[i].Code)
            listName.add(paperPerAnalysisInfor.TypeList[index_A].QuesDetailList[index_B].ImportKlgList[i].Name)
            listUniqueCode.add(paperPerAnalysisInfor.TypeList[index_A].QuesDetailList[index_B].ImportKlgList[i].UniqueCode)
        }
        AibkKnowledgeListActivity.launch(activity, listCode, listName, listUniqueCode)
    }


//    fun goToCommentDetailActivity(activity: AppCompatActivity,
//                                  paperEvaluationInfor: PaperEvaluationInfor,
//                                  indexA: Int,
//                                  indexB: Int) {
//        activity.startActivity(Intent(activity, CommentDetailActivity::class.java).apply {
//            val quesID = paperEvaluationInfor.TypeList[indexA].QuesList[indexB].QuesID
//            val paperID = paperEvaluationInfor.PaperName
//            val setID = paperEvaluationInfor.S
//            val paperName = paperEvaluationInfor.PaperName
//            putExtra("QuesID", quesID)
//            putExtra("PaperID", paperID)
//            putExtra("SetID", setID)
//            putExtra("PaperName", paperName)
//            putExtra("isCommented", finished)
//        })
//        if (finished) {
//            OperationHelp.operationLog(7, activity)
//        }
//    }

}